Skip to content

Add yang.settings toggles for language server features#254

Open
esmasth wants to merge 1 commit intoTypeFox:masterfrom
esmasth:esmasth/issue253
Open

Add yang.settings toggles for language server features#254
esmasth wants to merge 1 commit intoTypeFox:masterfrom
esmasth:esmasth/issue253

Conversation

@esmasth
Copy link
Copy Markdown
Collaborator

@esmasth esmasth commented Mar 30, 2026

Summary

Adds on/off toggle settings in yang.settings for 12 LSP features, allowing users to disable individual features for performance or compatibility reasons.

Changes

  • YangFeatureToggleKeys.java (new) — Preference keys for all toggleable features
  • YangSyncDiagramLanguageServer.java — All feature toggle overrides (semantic tokens, completion, hover, definition, references, document symbols, document highlight, rename, code actions, formatting)
  • yang-lsp-settings-schema.json — Added all toggle entries; fixed code-lens-enabledcode-lenses to match the actual preference key in CodeLensService
  • docs/Settings.md — Updated documentation with feature toggles section
  • FeatureToggleTest.xtend — Test verifying validation produces issues by default

Design

All toggle checks are centralized in YangSyncDiagramLanguageServer rather than distributed across individual service classes. This avoids issues with PreferenceValuesProvider injection in contexts where the full language runtime isn't available (e.g., LSP integration tests), and keeps the guard logic in one place.

The existing code-lenses toggle in CodeLensService is left as-is since it predates this change and works correctly.

Settings

All features default to on. Example yang.settings:

{
    "semantic-tokens": "off",
    "code-lenses": "off",
    "validation": "on"
}

Note: The only pre-existing test failure is CodeLensTest.testCodeLens which also fails on upstream master.

Closes #253

@esmasth esmasth force-pushed the esmasth/issue253 branch 2 times, most recently from a6a0c8b to 68aee8b Compare March 31, 2026 04:50
Add on/off toggle settings for 12 LSP features: code-lenses,
semantic-tokens, validation, formatting, code-actions, completion,
hover, definition, references, document-symbols, document-highlight,
and rename. All default to 'on'.

Also fixes the settings schema key 'code-lens-enabled' to match the
actual preference key 'code-lenses' used in CodeLensService.

Closes TypeFox#253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add yang.settings toggles for language server features

1 participant